Skip to content

bfcl patch#821

Closed
hellovai wants to merge 3 commits intocanaryfrom
bfcl-patch
Closed

bfcl patch#821
hellovai wants to merge 3 commits intocanaryfrom
bfcl-patch

Conversation

@hellovai
Copy link
Copy Markdown
Contributor

  • Adding some hooks to allow testing BFCL
  • update builder

@vercel
Copy link
Copy Markdown

vercel Bot commented Jul 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
baml ❌ Failed (Inspect) Jul 23, 2024 0:11am

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

The pull request introduces serialization capabilities and new methods for enhanced testing and debugging across various components.

  • engine/baml-lib/jinja/src/lib.rs: Added Serialize trait to RenderedPrompt and RenderContext_Client, updated render_prompt function for type safety, and included new unit tests.
  • engine/baml-runtime/src/internal/llm_client/mod.rs: Added Serialize trait to multiple structs and enums for better data handling.
  • engine/language_client_codegen/src/python/templates/async_client.py.j2: Introduced z_unstable_runtime and z_unstable_ctx_manager methods in BamlAsyncClient for internal access.
  • engine/language_client_python/src/types/function_results.rs: Added internals method to FunctionResult for JSON serialization of internal LLM responses.
  • engine/language_client_python/src/types/type_builder.rs: Enhanced type-building capabilities with new methods and imports from pyo3.

8 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The pull request introduces a macro for reducing redundancy in Python client struct implementations and adds an unstable async client template.

  • engine/language-client-codegen/src/python/mod.rs: Introduced a macro to streamline From and TryFrom trait implementations for Python clients.
  • engine/language-client-codegen/src/python/templates/unstable_async_client.py.j2: Added UnstableBamlAsyncClient class for handling asynchronous BAML operations.
  • engine/language-client_python/python_src/baml_py/baml_py.pyi: Removed List import from the typing module; ensure no dependencies are affected.

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

Comment on lines +70 to +73
if raw.is_ok() is None:
mdl = create_model("{{ fn.name }}ReturnType", inner=({{ fn.return_type }}, ...))
return raw, (True, coerce(mdl, raw.parsed()))
return raw, (False, None)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic: The condition if raw.is_ok() is None seems incorrect. It should likely be if raw.is_ok() to check if the result is successful.

@hellovai hellovai marked this pull request as draft November 4, 2024 06:52
@aaronvg aaronvg closed this Apr 18, 2025
@aaronvg aaronvg deleted the bfcl-patch branch May 17, 2025 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants